package com.sluggard.security.manage.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sluggard.mp.model.entity.StandardAuditEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * <p>
 * 系统码表
 * </p>
 *
 * @author lizheng
 * @since 2024-04-28
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("sys_code")
@Schema(name = "Code", description = "系统码表")
public class CodeEntity extends StandardAuditEntity {

    private static final long serialVersionUID = 1L;

    @Schema(description = "父ID")
    @TableField("pid")
    private Long pid;

    @Schema(description = "编码")
    @TableField("code")
    private String code;

    @Schema(description = "名称")
    @TableField("name")
    private String name;

    @Schema(description = "备注")
    @TableField("comments")
    private String comments;

    @TableField(exist = false)
    @Schema(description = "子集合")
    private List<CodeEntity> children;
}
